import React from 'react'
import ReactDOM from 'react-dom'
import { BrowserRouter } from 'react-router-dom'
import { LocaleProvider } from 'antd'
import App from './pages/App'
import axios from './plugs/axios'

// 本地化
import zhCN from 'antd/lib/locale-provider/zh_CN'
import moment from 'moment'
import 'moment/locale/zh-cn'
moment.locale('zh-cn')

// 挂载插件
React.Component.prototype.$moment = moment
React.Component.prototype.$http = axios

ReactDOM.render(
  // 使用 BrowserRouter 去包裹路由
  <BrowserRouter>
    <LocaleProvider locale={zhCN}>
      <App />
    </LocaleProvider>
  </BrowserRouter>,
  document.getElementById('root')
)
